﻿<internal:BaseControlPartView x:Class="UColor.WPF.Internal.BaseControlPagesContainerView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:ddhelpers="clr-namespace:UColor.Core.Helpers;assembly=UColor.Core"
    xmlns:parts="clr-namespace:UColor.Core.Parts;assembly=UColor.Core"
    xmlns:internal="clr-namespace:UColor.WPF.Internal"
    xmlns:dxdb="clr-namespace:UColor.WPF"
    mc:Ignorable="d" 
    d:DesignHeight="300" d:DesignWidth="300">

    <internal:BaseControlPartView.Resources>
        <dx:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
    </internal:BaseControlPartView.Resources>
    <Border>
        <Border.Background>
            <LinearGradientBrush EndPoint="0.625,1.051" StartPoint="0.304,-0.187">
                <GradientStop Color="#FF716086" />
                <GradientStop Color="#FF6F6296" Offset="1" />
                <GradientStop Color="#FF413B58" Offset="0.3" />
            </LinearGradientBrush>
        </Border.Background>
        <Grid Margin="0,30,0,0">
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <ddhelpers:ViewPresenter Content="{Binding CurrentPage.View}" CachedContent1="{Binding MainPage.View}"  Storyboard="{Binding AnimationDirection}" Margin="60,0,40,20"
            ActualContentChangedCommand="{Binding RaiseActualPageChangedCommand}">
                <ddhelpers:ViewPresenter.Resources>
                    <Storyboard x:Key="Forward">
                        <DoubleAnimation From="1" To="0" Duration="00:00:00.50" Storyboard.TargetProperty="(ddhelpers:ViewPresenter.NewContentTranslateX)" />
                        <DoubleAnimation From="0" To="-1" Duration="00:00:00.50" Storyboard.TargetProperty="(ddhelpers:ViewPresenter.OldContentTranslateX)" />
                        <DoubleAnimation To="1" Duration="00:00:00.50" Storyboard.TargetProperty="(ddhelpers:ViewPresenter.NewContent).(UIElement.Opacity)" />
                        <DoubleAnimation To="0" Duration="00:00:00.50" Storyboard.TargetProperty="(ddhelpers:ViewPresenter.OldContent).(UIElement.Opacity)" />
                    </Storyboard>
                    <Storyboard x:Key="Back">
                        <DoubleAnimation From="-1" To="0" Duration="00:00:00.50" Storyboard.TargetProperty="(ddhelpers:ViewPresenter.NewContentTranslateX)" />
                        <DoubleAnimation From="0" To="1" Duration="00:00:00.50" Storyboard.TargetProperty="(ddhelpers:ViewPresenter.OldContentTranslateX)" />
                        <DoubleAnimation To="1" Duration="00:00:00.50" Storyboard.TargetProperty="(ddhelpers:ViewPresenter.NewContent).(UIElement.Opacity)" />
                        <DoubleAnimation To="0" Duration="00:00:00.50" Storyboard.TargetProperty="(ddhelpers:ViewPresenter.OldContent).(UIElement.Opacity)" />
                    </Storyboard>
                </ddhelpers:ViewPresenter.Resources>
            </ddhelpers:ViewPresenter>
            <dxdb:BaseLoadingControl LoadingInProgress="{Binding LoadingInProgress}" HorizontalAlignment="Center" VerticalAlignment="Center" />
            <parts:BackButton HorizontalAlignment="Left" VerticalAlignment="Top" Command="{Binding BackCommand}" IsEnabled="{Binding AllowUseBackButton}" Visibility="{Binding ActualShowBackButton, Converter={StaticResource BoolToVisibilityConverter}}" />
        </Grid>
    </Border>
</internal:BaseControlPartView>
